<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%
	String port = request.getServerPort() == 80 ? "" : ":".concat(request.getServerPort()+"");
	String path = request.getScheme().concat("://").concat(request.getServerName()).concat(port).concat(request.getContextPath());
	request.setAttribute("path", path);
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html>
<head>
<title>角色列表 - 个人中心 - IT答案网</title>
<meta name="keywords" content="角色列表" />
<meta name="description" content="角色列表" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="${path }/view/portal/css/all.css" rel="stylesheet">
<link href="${path }/view/portal/css/prettify.css" rel="stylesheet">
<script src="${path }/view/portal/js/all.js"></script>
</head>
<body>
  <jsp:include page="head.jsp"></jsp:include>
  <div class="container container1000">
	<div class="content">
	    <shiro:hasRole name="admin">
		<input type="button" class="btn btn-small btn-primary" value="添加" onclick="edit();">
		<input type="button" class="btn btn-small btn-danger" value="删除" onclick="doBatch('ids', '${ctx}/user/role/delete?ids=');">
		</shiro:hasRole>
	    <br/>
		<table class="table table-bordered table-striped table-condensed">
			<thead>
				<tr>
				<shiro:hasRole name="admin">
					<th class="span1">
						<input type="checkbox" id="selectall" name="selectall" onclick="selectAll('selectall', 'ids')">
					</th>
				</shiro:hasRole>	
					<th>角色名</th>
					<th>角色中文名称</th>
					<th>角色描述</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${roles }" var="data">
					<tr>
						<shiro:hasRole name="admin"><td><input type="checkbox" name="ids" value="${data.id }"></td></shiro:hasRole>
						<td>
							<shiro:hasRole name="admin"><a href="${ctx }/user/role/edit?id=${data.id }" title="${data.name }"></shiro:hasRole>
								<font color=''>${data.name }</font>
							<shiro:hasRole name="admin"></a></shiro:hasRole>
						</td>
						<td>${data.cnName }</td>
						<td>${data.description }</td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
	
	</div>
 </div>	
	<script src="${ctx}/view/user/js/common.js"></script>
	<script type="text/javascript">
		function edit() {
			window.location.href='${ctx}/user/role/edit';
		}
	</script>
	
  <div class="clear">&nbsp;</div>
   
  <jsp:include page="bottom.jsp"></jsp:include>  
</body>
</html>		